<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of mManageUser
 *
 * @author SG10015
 */


$q = isset($_POST['q']) ? strval($_POST['q']) : '';
$rs = @mysql_query("SELECT TCKT_CODE, TCKT_DESC, 
                            case TCKT_ACTIVE  
                                when '1' then 'Aktif'
                                when '0' then 'Tidak Aktif'  
                            end as TCKT_ACTIVE                             
                        FROM trv_mproduct 
                       WHERE TCKT_ACTIVE='1' and (TCKT_DESC like '%".$q."%' or TCKT_CODE like '%".$q."%')");
$rows = array();
while($row = @mysql_fetch_assoc($rs)){
	$rows[] = $row;
}
echo json_encode($rows);
?>
